package com.theo.service.impl;

import com.theo.entity.RumourInfo;
import com.theo.mapper.RumourInfoMapper;
import com.theo.service.RumourInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 方涛
 * @since 2021-02-02
 */
@Service
public class RumourInfoServiceImpl extends ServiceImpl<RumourInfoMapper, RumourInfo> implements RumourInfoService {

    @Autowired
    private RumourInfoMapper rumourInfoMapper;

    @Override
    public int saveRumourInfo(RumourInfo rumourInfo) {
        return rumourInfoMapper.insert(rumourInfo);
    }

    @Override
    public int deleteRumourInfo(Integer id) {
        return rumourInfoMapper.deleteById(id);
    }

    @Override
    public int updateRumourInfo(RumourInfo rumourInfo) {
        return rumourInfoMapper.updateById(rumourInfo);
    }

    @Override
    public List<RumourInfo> queryAllRumourInfo() {
        return rumourInfoMapper.queryAllRumourInfo();
    }

    @Override
    public RumourInfo queryRumourInfoById(Integer id) {
        return rumourInfoMapper.selectById(id);
    }
}
